package com.gwsdk.paysdk.dialog;
import android.annotation.SuppressLint;
import android.app.DialogFragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.gwsdk.paysdk.utils.GWInflaterUtils;

public class GWVoiceTipDialog extends DialogFragment{

    private Context context;

    public GWVoiceTipDialog(){

    }

    @SuppressLint("ValidFragment")
    public GWVoiceTipDialog(Context context){
        this.context = context;
    }

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        // 设置对话框的样式
        setStyle(STYLE_NO_FRAME, GWInflaterUtils.getIdByName(context, "style",
                "gw_tip_dialog"));
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        View containerView = inflater.inflate(GWInflaterUtils.getLayout(context,"gw_dialog_voice_tip"), container, false);

        containerView.findViewById(GWInflaterUtils.getControl(context,"btn_ok")).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        setCancelable(false);
        return containerView;
    }

}
